-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[JEWEL-992] Hide mouse cursor while typing in BTF on macOS #3372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[JEWEL-992] Hide mouse cursor while typing in BTF on macOS #3372
Conversation
faogustavo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blockers :)
3c1838d to
8f771d3
Compare
...e/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePlatformCursorController.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/HideCursorOnTyping.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/platform/PlatformCursorController.kt
Show resolved
Hide resolved
8f771d3 to
e3fc7bf
Compare
e3fc7bf to
cd4537d
Compare
...e/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePlatformCursorController.kt
Show resolved
Hide resolved
...e/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePlatformCursorController.kt
Show resolved
Hide resolved
rock3r
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Couple minor notes
...e/src/main/kotlin/org/jetbrains/jewel/intui/standalone/StandalonePlatformCursorController.kt
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/HideCursorOnTyping.kt
Outdated
Show resolved
Hide resolved
platform/jewel/ui/src/main/kotlin/org/jetbrains/jewel/ui/platform/PlatformCursorController.kt
Outdated
Show resolved
Hide resolved
cd4537d to
f5f2c94
Compare
rock3r
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
f5f2c94 to
fbc46c1
Compare
Summary
Implements cursor hiding behavior on macOS when typing in text fields, matching the native IDE behavior. The cursor automatically hides when the user types and reappears when the mouse moves.
Evidence
Screen.Recording.2026-01-06.at.6.37.57.PM.mov
Implementation Details
Architecture
Added a platform-specific cursor controller abstraction using Compose composition locals:
PlatformCursorController- Interface for platform-specific cursor controlStandalonePlatformCursorController- macOS implementation using JNA to call[NSCursor setHiddenUntilMouseMoves:YES]BridgePlatformCursorController- Bridge implementation usingMacUIUtil.hideCursor()NoOpPlatformCursorController- Fallback for unsupported platformsIntegration
InputFieldcomponents via.hideCursorOnTyping()modifierLocalPlatformCursorControllercomposition local:IntUiTheme→StandalonePlatformCursorControllerSwingBridgeTheme→BridgePlatformCursorControllerRelease notes
New features
Note
Implements macOS cursor-hiding behavior and abstracts platform-specific control.
PlatformCursorControllerandLocalPlatformCursorControllercomposition localBridgePlatformCursorController(usesMacUIUtil.hideCursor()),StandalonePlatformCursorController(uses JNA to call[NSCursor setHiddenUntilMouseMoves:])SwingBridgeTheme→BridgePlatformCursorController,IntUiTheme→StandalonePlatformCursorControllerInputFieldvia.hideCursorOnTyping()(key preview on keydown; active only when enabled and not read-only)Written by Cursor Bugbot for commit fbc46c1. This will update automatically on new commits. Configure here.